// 筛选值
export const PriceOutsideOptions =  (data:any, value: any)=>{
    
    const { 
        customer_group, //客户分组
        customer_type, //客户类别
        price_create_user, //创建人
        price_customer, //客户
        price_number, //客户价目表
        price_status, //价目表状态
        price_update_user, //更新人
        use_org_id, //使用组织
        currency, //人民币

        customer_list, //适用客户
        product_number, //产品编码
        product_name, //产品名称
        forbid_status, //生效状态
    } = data
    
    if (value == 'use_org_id') {
        return use_org_id.map((item:any)=>{
            return { value: Number(item.uid), label: item.name }
        })
    }
    if (value == 'customer_group_id') {
        return customer_group.map((item:any)=>{
            return { value: item.id, label: item.name }
        })
    }
    if (value == 'number') {
        return price_number.map((item:any)=>{
            return { value: item.id, label: item.number }
        })
    }
    if (value == 'name') {
        return price_number.map((item:any)=>{
            return { value: item.id, label: item.name }
        })
    }
    if (value == 'product_number') {
        return product_number.map((item:any)=>{
            return { value: item.number, label: item.number }
        })
    }
    if (value == 'product_name') {
        return product_name.map((item:any)=>{
            return { value: item.name, label: item.name }
        })
    }

    if (value == 'customer_name_id') {
        return price_customer.map((item:any)=>{
            return { value: item.customer_id, label: item.customer_name }
        })
    }
    if (value == 'customer_number_id') {
        return price_customer.map((item:any)=>{
            return { value: item.customer_id, label: item.customer_number }
        })
    }
    if (value == 'customer_name') {
        return price_customer.map((item:any)=>{
            return { value: item.customer_name, label: item.customer_name }
        })
    }

    if (value == 'update_user_id') {
        return price_update_user.map((item:any)=>{
            return { value: item.update_user_id, label: item.update_user_name }
        })
    }
    if (value == 'create_user_id') {
        return price_create_user.map((item:any)=>{
            return { value: item.create_user_id, label: item.create_user_name }
        })
    }
    if (value == 'customer_type_id') {
        return customer_type.map((item:any)=>{
            return { value: item.id, label: item.label }
        })
    }
    if (value == 'status') {
        return price_status.map((item:any)=>{
            return { value: `${item.id}`, label: item.name }
        })
    }
    if (value == 'currency_id') {
        return currency.map((item:any)=>{
            return { value: item.id, label: item.label }
        })
    }
    if (value == 'customer_id') {
        return customer_list.map((item:any)=>{
            return { value: `${item.id}`, label: item.name }
        })
    }
    if (value == 'forbid_status') {
        return forbid_status.map((item:any)=>{
            return { value: `${item.id}`, label: item.name }
        })
    }
    return []
}

// 生效状态tag_color
export const forbidStatusColor = (value:string)=>{
    if (value == '已生效') return 'success'
    if (value == '已失效') return 'warning'
    if (value == '待生效') return 'info'
    return 'info'
}

/**
 * 客户价目表-查询
 */


export const CheckSearch = [
    {  label: '使用组织', prop: 'use_org_id', type: 'select', multiple: false },
    {  label: '价目表编码', prop: 'number', type: 'select', multiple: false },
    {  label: '价目表名称', prop: 'name', type: 'select', multiple: false },
    {  label: '复合查询', prop: '1', type: 'composite' },
    {  label: '复合查询', prop: '2', type: 'composite' },
    {  label: '复合查询', prop: '3', type: 'composite' },
]
export const CheckCompositeSearch2 = [
    {  label: '生效状态', value: 'forbid_status', formType: 'select' },
    {  label: '创建人', value: 'create_user_id', formType: 'select', },
    {  label: '最后更新人', value: 'update_user_id', formType: 'select', },
    {  label: '有效期', value: 'effective_date', formType: 'time', timeType: 'datetimerange' },
    // {  label: '失效时间', value: 'expiry_date', formType: 'time', timeType: 'datetimerange' },
    // {  label: '客户类别', value: 'customer_type_id', formType: 'select', },
    // {  label: '客户分组', value: 'customer_group_id', formType: 'select', },
] 

export const CheckCompositeSearch1 = [
    {  label: '价目表状态', value: 'status', formType: 'select' },
    {  label: '创建人', value: 'create_user_id', formType: 'select', },
    {  label: '最后更新人', value: 'update_user_id', formType: 'select', },
    {  label: '有效期', value: 'effective_date', formType: 'time', timeType: 'datetimerange' },
] 
export const CheckCompositeSearch3 = [
    {  label: '客户名称', value: 'customer_name', formType: 'select' },
    {  label: '创建人', value: 'create_user_id', formType: 'select', },
    {  label: '最后更新人', value: 'update_user_id', formType: 'select', },
    {  label: '有效期', value: 'effective_date', formType: 'time', timeType: 'datetimerange' },
] 

export const CheckHostCloums = [
    { label: '使用组织', prop: 'user_org_name', width: '240' },
    { label: '价目表编码', prop: 'number', width: '140', type: 'custom'},
    { label: '价目表名称', prop: 'name', width: '220' },
    { label: '客户编码', prop: 'customer_number', width: '120' },
    { label: '客户名称', prop: 'customer_name', width: '300' },
    { label: '价目表状态', prop: 'status_str', width: '100' },
    { label: '生效状态', prop: 'forbid_status_str', width: '100', type: 'custom' },
    { label: '生效日期', prop: 'effective_date', width: '120', type: 'time' },
    { label: '失效日期', prop: 'expiry_date', width: '120', type: 'time' },
    { label: '创建人', prop: 'create_user_name', width: '100' },
    { label: '创建时间', prop: 'created_at', width: '120', type: 'time' },
    { label: '最后更新人', prop: 'update_user_name', width: '100', type: '' },
    { label: '最后更新时间', prop: 'updated_at', width: '120', type: 'time' },
]
export const CheckSonCloums = [
    { label: '客户编码', prop: 'spec_no', },
    { label: '客户名称', prop: 'barcode'},
    { label: '客户类别', prop: 'name', width: '260'  },
    { label: '客户分组', prop: 'brand',  },
    { label: '是否集团公司', prop: 'num', type: 'number'  },
]

/**
 * 客户价目表-创建
 */

export const CreateBaseForm = [
    {  label: '价目表名称', prop: 'name', type: 'input', multiple: false, disabled: false},
    {  label: '使用组织', prop: 'use_org_id', type: 'select', multiple: false, disabled: false},
    {  label: '价目表编码', prop: 'number', type: 'text', multiple: false, },
    {  label: '适用客户', prop: 'customer_id', type: 'select', multiple: false, disabled: false},
    {  label: '币别', prop: 'currency_id', type: 'select', disabled: false},
    {  label: '有效期', prop: 'expiration_date', type: 'time', disabled: false},
    {  label: '含税', prop: 'is_included_tax', type: 'radio', multiple: false, disabled: false},
]
export const CreateBaseFormDisabled = [
    {  label: '价目表名称', prop: 'name', type: 'input', multiple: false, disabled: true},
    {  label: '使用组织', prop: 'use_org_id', type: 'select', multiple: false, disabled: true},
    {  label: '价目表编码', prop: 'number', type: 'text', multiple: false, disabled: true},
    {  label: '适用客户', prop: 'customer_id', type: 'select', multiple: false, disabled: true},
    {  label: '币别', prop: 'currency_id', type: 'select', disabled: true},
    {  label: '有效期', prop: 'expiration_date', type: 'time', disabled: true},
    {  label: '含税', prop: 'is_included_tax', type: 'radio', multiple: false, disabled: true},
]
export const ProductPriceCloums = {
    id: 0,
    sales_num: 0,
    goods_no: '',
    batch_usable_num: 0,
    batch_no: '',
    expire_date: '',
    amount: 0.0,
    goods_name: '',
    barcode: '',
    spec_name: '',
    brand_name: '',
    goods_type: '',
    sales_unit: '',
    order_price: '',
    including_tax_price: 0.0,
    tax_rate: '',
    tax: '',
    total_amount: 0.0,
    warehouse_no: '',
    warehouse_name: '',
    stock_org_name: '',
    settle_org_name: '',
    remark: '',
}
export const ScopeCloums = [
    { label: '产品编码', prop: 'short_name' , required: true },
    { label: '产品名称', prop: 'stockout_no', required: true },
    { label: '规格型号', prop: 'src_order_type_str', width: '100' , required: true },
    { label: '批次号', prop: 'status_str', width: '100' , required: false},
    { label: '计价单位', prop: 'aaa', width: '140' , required: true },
    { label: '价格系数', prop: 'aaa', width: '140' , required: false},
    { label: '价格', prop: 'operator_name', width: '80' , required: true },
    { label: '底价', prop: 'picker_name', width: '140', type: '' , required: true },
    { label: '标准零售价', prop: 'examiner_name', width: '80', type: '' , required: true },
]


/**
 * 详情
 */
export const BaseDetail = [
    {  label: '价目表名称', prop: 'name' },
    {  label: '使用组织', prop: 'user_org_name' },
    {  label: '价目表编码', prop: 'number' },
    {  label: '适用客户', prop: 'customer_name' },
    {  label: '币别', prop: 'currency_name' },
    {  label: '有效期', prop: 'A_B', type: 'custom' },
    {  label: '含税', prop: 'is_included_tax',  type: 'custom'},
   
]
export const ProductDetail = [
    { label: '产品编码', prop: 'number', width: '160'  , disable: true},
    { label: '产品名称', prop: 'name',  width: '260' , disable: true},
    { label: '规格型号', prop: 'specification', width: '100'  , disable: true},
    // { label: '批次号', prop: 'batch_no', width: '120' , disable: true},
    { label: '计价单位', prop: 'unit_name', width: '140' , disable: true},
    { label: '价格', prop: 'price', width: '120', type: 'custom' , disable: true},
    { label: '底价', prop: 'down_price', width: '140', type: 'custom' , disable: true},
    { label: '是否失效', prop: 'forbid_status_str', width: '100', type: 'custom' , disable: true},
    { label: '生效日期', prop: 'effective_date', width: '160', type: 'time', disable: true},
    { label: '失效日期', prop: 'expiry_date', width: '160', type: 'time', disable: true},
    { label: '失效人员', prop: 'forbider_name', width: '100', type: '', disable: true},
    { label: '行审核状态', prop: 'row_audit_status_str', width: '120', type: '', disable: true},
]
